#include <stdio.h>
#include <vector>
#include <algorithm>

struct test {
    char c;
    int s;
};


int main(int argc, const char **argv) {

    std::vector<test> t { {'a', 1} , {'a', 2}, {'a', 3}, {'b', 1}, {'b', 2}, {'b', 3}, {'c', 1}, {'c', 2}, {'c', 3}};

    std::sort(t.begin(), t.end(), [] (const test& first, const test& second) {
        if (first.c == 'c' && second.c != 'c') {
            return true;
        }

        if (first.c == 'a' && second.c == 'b') {
            return true;
        }

        if (first.c == 'c' && second.c == 'c') {
            return first.s > second.s;
        }

        if (first.c != 'c' && second.c == first.c) {
            return first.s < second.s;
        }

        return false;
    });

    for (const auto& info : t) {
        printf("%c -> %d\n", info.c, info.s);
    }

    return 0;
}
